#pragma once
#include <iostream>
#include <pthread.h>

class Mutex
{
    friend class Conditional;
private:
    pthread_mutex_t _mtx;
public:
    Mutex()
    {
        pthread_mutex_init(&_mtx,nullptr);
    }
    ~Mutex()
    {
        pthread_mutex_destroy(&_mtx);
    }

    void Lock()
    {
        pthread_mutex_lock(&_mtx);
    }
    void UnLock()
    {
        pthread_mutex_unlock(&_mtx);
    }
};